package com.qls.gateway.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author doyoung
 */
@Configuration
public class GatewayConfig {

    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
        return builder.routes()
                .route("mt", r -> r.path("/mt/**").uri("lb://mt-service"))
                .route("ali", r -> r.path("/ali/**").uri("lb://ali-service"))
                .build();
    }
}
